package main

import (
	"fmt"
	"time"
)

func main() {

	sing()
	//执行玩了 sing 才会执行dance
	dance()

	fmt.Println("-----------------")
	//异步执行sing
	go sing()
	//异步执行dance
	go dance()

	for {
		fmt.Println("........")
		time.Sleep(time.Millisecond)
	}
}

func sing() {
	for i := 0; i < 10; i++ {
		fmt.Println("我在唱歌...")
		time.Sleep(time.Millisecond)
	}
}

func dance() {
	for i := 0; i < 10; i++ {
		fmt.Println("我在跳舞...")
		time.Sleep(time.Millisecond)
	}
}
